<?php

function addslashesextended(&$arr_r)
{
	global $config;
	mysql_connect($config['dbhost'], $config['dbuser'], $config['dbpass']);
    if(is_array($arr_r))
    {
        foreach($arr_r as $key => &$val)
        {
			if($key == 'contestfile' || $key == 'validationfile') continue;
			if(is_array($val))
			{
				addslashesextended($val);
			}
			else
			{
				//$val = addslashes($val);
				$val = mysql_real_escape_string($val);
			}
			unset($val);
		}
    }
    else
    {
		//$arr_r = addslashes($arr_r);
		$arr_r = mysql_real_escape_string($arr_r);
	}
}

function Secure()
{
	addslashesextended($_POST);
	addslashesextended($_GET);
	addslashesextended($_COOKIES);
}

?>